layui.use(['form','layer','table','laytpl','jquery'],function(){
    var form = layui.form,
        layer =   layui.layer,
        $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table;

    //用户列表
    var tableIns = table.render({
        elem: '#projectTable',
        url : 'projectServlet',
        cellMinWidth : 95,
        page : true,
        height : "full-125",
        limits : [10,15,20,25],
        limit : 10,
        id : "projectTable",
        cols : [[
            {type: "checkbox", fixed:"left", width:50},
            {field: 'projectName', title: '项目', minWidth:100, align:"center"},
            {field: 'projectCategory', title: '项目分类', minWidth:200, align:'center'},
            {field: 'isEvaluated', title: '评估状态', align:'center'},
            {field: 'status', title: '完成状态',  align:'center',templet:function(d){
                return d.status == "0" ? "未完成" : "完成";
            }},
            {field: 'linkMan', title: '联系人', align:'center',minWidth:150},
            {field: 'openDate', title: '开标时间', align:'center',minWidth:150},
            {title: '操作', minWidth:175, templet:'<a>not supprot</a>',fixed:"right",align:"center"}
        ]]
    });

    //搜索【此功能需要后台配合，所以暂时没有动态效果演示】
    $(".search_btn").on("click",function(){
        if($(".searchVal").val() != ''){
            table.reload("newsListTable",{
                page: {
                    curr: 1 //重新从第 1 页开始
                },
                where: {
                    key: $(".searchVal").val()  //搜索的关键字
                }
            })
        }else{
            layer.msg("请输入搜索的内容");
        }
    });
  
})